; These tests are based on clang/test/CodeGenCXX/mangle-ms-template-callback.cpp

; RUN: llvm-undname < %s | FileCheck %s

; CHECK-NOT: Invalid mangled name

?callback_void@@3V?$C@$$A6AXXZ@@A
; CHECK: class C<void __cdecl(void)> callback_void

?callback_void_volatile@@3V?$C@$$A6AXXZ@@C
; CHECK: class C<void __cdecl(void)> volatile callback_void_volatile

?callback_int@@3V?$C@$$A6AHXZ@@A
; CHECK: C<int __cdecl(void)> callback_int

?callback_Type@@3V?$C@$$A6A?AVType@@XZ@@A
; CHECK: C<class Type __cdecl(void)> callback_Type

?callback_void_int@@3V?$C@$$A6AXH@Z@@A
; CHECK: C<void __cdecl(int)> callback_void_int

?callback_int_int@@3V?$C@$$A6AHH@Z@@A
; CHECK: C<int __cdecl(int)> callback_int_int

?callback_void_Type@@3V?$C@$$A6AXVType@@@Z@@A
; CHECK: C<void __cdecl(class Type)> callback_void_Type

?foo@@YAXV?$C@$$A6AXXZ@@@Z
; CHECK: void __cdecl foo(class C<void __cdecl(void)>)

?function@@YAXV?$C@$$A6AXXZ@@@Z
; CHECK: void __cdecl function(class C<void __cdecl(void)>)

?function_pointer@@YAXV?$C@P6AXXZ@@@Z
; CHECK: void __cdecl function_pointer(class C<void (__cdecl *)(void)>)

?member_pointer@@YAXV?$C@P8Z@@AEXXZ@@@Z
; CHECK: void __cdecl member_pointer(class C<void (__thiscall Z::*)(void)>)

??$bar@P6AHH@Z@@YAXP6AHH@Z@Z
; CHECK: void __cdecl bar<int (__cdecl *)(int)>(int (__cdecl *)(int))

??$WrapFnPtr@$1?VoidFn@@YAXXZ@@YAXXZ
; CHECK: void __cdecl WrapFnPtr<&void __cdecl VoidFn(void)>(void)

??$WrapFnRef@$1?VoidFn@@YAXXZ@@YAXXZ
; CHECK: void __cdecl WrapFnRef<&void __cdecl VoidFn(void)>(void)

??$WrapFnPtr@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ
; CHECK: void __cdecl WrapFnPtr<&public: static void __cdecl Thing::VoidStaticMethod(void)>(void)

??$WrapFnRef@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ
; CHECK: void __cdecl WrapFnRef<&public: static void __cdecl Thing::VoidStaticMethod(void)>(void)
